# 定义 roll 函数
roll <- function(){
  dice_faces <- 1:6
  #probabilities <- c(1/6, 1/6, 1/6, 1/6, 1/6, 1/6)
  #result <- sample(dice_faces, size = 2, prob = probabilities, replace = TRUE)
  result <- sample(dice_faces, size = 2, replace = TRUE)
  return (sum(result))
}

#投掷两次
roll <-function(){
  die <- 1:6
  dice <- sample(die,size=2,replace =TRUE)
  sum(dice)
}
roll()


